title: "Using walmartR" author: "Elka Mao" date: "r Sys.Date()" output: md_document: variant: markdown_github --walmartR: Access Walmart.com via R =======================================

Install, load the package

To install the latest version from Github

# install.packages('devtools')
devtools::install_github("Elkamao/walmartR")

Next, load the package:

library(walmartR)

Using the package

To start, register an developer account on Walmart Open API (see https://developer.walmartlabs.com/member) and obtain an API key.

wal_key = [Your API key]

Product Lookup

You can look up one item at a time.

product_lookup(wal_key, "12417832")

Or you can look up a list of items at the same time.

product_lookup(wal_key, "12417832,19336123")

Item Search

Search for Ipod

item_search(wal_key, query ="ipod")

Search for TVs with facets on

item_search(wal_key, query = "tv", facet = "on")

You can use the facet name and any of the facet values to further narrow down the search. To search for TVs of only a particular brand, say Samsung:

item_search(wal_key, query = "tv", facet = "on", facet_filter = "brand:Samsung")

Taxonomy

taxonomy(wal_key)

Product Recommendation

Each item on Walmart.com has a particular item ID associated with it. This can be generally seen in the last 8 digits of a URL string, but can also be acquired by using the product_lookup function (Required)

product_recommendation(wal_key, "36904791")

Post Browsed Products Recommendation

Same item Id as used in the prouct recommendation fucntion.

postbrowse_recommendation(wal_key, "36904791")

Store Locator

Nearest walmart stores for latitude 29.735577 and longitude -95.511747

store_locator(wal_key, lon="-95.511747", lat="29.735577")

Walmart stores in the city of New York

store_locator(wal_key, city = "NEW YORK")

Walmart stores in the zip 10025

store_locator(wal_key, zip = "10025")

Trending

trending(wal_key)

References

https://developer.walmartlabs.com/docs



Elkamao/walmartR documentation built on May 24, 2019, 5:02 a.m.